//package org.example.controller;
//
//
//import org.example.dto.ResumeAnalysisResponse;
//import org.example.service.ResumeAnalysisService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.http.HttpStatus;
//import org.springframework.http.ResponseEntity;
//import org.springframework.web.bind.annotation.*;
//import org.springframework.web.multipart.MultipartFile;
//
//@RestController
//@RequestMapping("/api/resume")
//public class ResumeAnalysisController {
//
//    private final ResumeAnalysisService resumeAnalysisService;
//
//    @Autowired
//    public ResumeAnalysisController(ResumeAnalysisService resumeAnalysisService) {
//        this.resumeAnalysisService = resumeAnalysisService;
//    }
//
//    @PostMapping(value = "/analyze", consumes = "multipart/form-data")
//    public ResponseEntity<ResumeAnalysisResponse> analyzeResumeFile(
//            @RequestParam("file") MultipartFile file) {
//        try {
//            if (file.isEmpty()) {
//                return ResponseEntity.badRequest()
//                        .body(new ResumeAnalysisResponse(false, "未上传文件", null));
//            }
//
//            if (file.getSize() > 5 * 1024 * 1024) {
//                return ResponseEntity.badRequest()
//                        .body(new ResumeAnalysisResponse(false, "文件大小超过5MB限制", null));
//            }
//
//            ResumeAnalysisResponse response = resumeAnalysisService.analyzeResumeFile(file,null);
//
//            return ResponseEntity.ok(response);
//        } catch (Exception e) {
//            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
//                    .body(new ResumeAnalysisResponse(false, "服务器内部错误: " + e.getMessage(), null));
//        }
//    }
//}
//
